var order_p_buss_no,order_p_order_no,order_p_order_no_sys,order_p_order_status,order_p_product_no,order_p_print;
var del_id,del_order_no,order_p_custmer,order_p_created;
var order_p_order_make_time_start,order_p_order_make_time_end,order_p_version_no,order_p_dept;
$(function(){
	queryClass();
	page.bind();
});
var page = { //页面总变量
	bind:function(){
		$("#search").unbind("click");
		$("#search").bind("click.my",function(){
			order_p_order_no=$("#order_p_order_no").val();
			order_p_order_status=$("#order_p_order_status").val();
			order_p_order_no_sys=$("#order_p_order_no_sys").val();
			order_p_product_no=$("#order_p_product_no").val();
			order_p_print=$("#order_p_print").val();
			order_p_buss_no=$("#order_p_buss_no").val();
			order_p_order_make_time_start=$("#order_p_order_make_time_start").val();
			order_p_order_make_time_end=$("#order_p_order_make_time_end").val();
			order_p_custmer=$("#order_p_custmer").val();
			order_p_created=$("#order_p_created").val();
			order_p_version_no=$("#order_p_version_no").val();
			order_p_dept = $("#order_p_dept").val();
			queryClass();
		})
		$(window.parent.document).find("span[data-href='orderlist.html']").parent().unbind('click.my');
		$(window.parent.document).find("span[data-href='orderlist.html']").parent().bind('click.my',function(){
			reloadData();
		})
		//增加监控保证返回订单列表页面可以是最新数据
		var oldclass="1";
		var orderListInterval = setInterval(function(){
			var newclass = $(window.parent.document).find("span[data-href='orderlist.html']").parent().attr("class");
			if(oldclass!=newclass&&oldclass!="1"){
				reloadData();
			}
			oldclass=newclass;
		},1000);
		$("#delete_order_sure").unbind("click.my");
		$("#delete_order_sure").bind("click.my",function(){
			page.deletesure();
		})
		//增加部门选择
		$.ajax({
	          type: 'POST',
	          url: "basicData/queryDept",
	          data: {},
	          success: function(data){
	        	  if(data.returnData.length>0){
	        		  $("#order_p_dept").empty();
	        		  $("#order_p_dept").append("<option value=''>请选择</option>");
	        		  for(var i = 0 ;i<data.returnData.length; i++){
	        			  $("#order_p_dept").append("<option value='"+data.returnData[i].departmentCode+"'>"+data.returnData[i].deptName+"</option>");
	        		  }
	        	  }
	          }
	   });
		//上下表头内容同步滚动
		$(".dataTables_scrollHead").css("overflow","auto")
		$(".dataTables_scrollHead").append("<style>	.dataTables_scrollHead::-webkit-scrollbar {display:none}</style>");
		$(".dataTables_scrollBody").scroll(function(event){
			$(".dataTables_scrollHead").scrollLeft($(this).scrollLeft()) ;
		});
	},
	seeAndPrint:function(self){//查看权限
		var order_no=$(self).attr("order_no");
		var template_id=$(self).attr("template_id");
		if(template_id==0){
			alert("该订单没有模版,不可编辑");
			return;
		}
		var businessTemplate = $(self).attr("businessTemplate");
		if(businessTemplate == 1){//如果是商务订单产生的生产订单
			$(window.parent.document).find("[data-href='./bomBusiness/produceOrder/createOrder.html']")[0].click();
    		$(window.parent.document).find("iframe[src='./bomBusiness/produceOrder/createOrder.html']")[0].src="./bomBusiness/produceOrder/createOrder.html?mode=look&sysOrderNo="+order_no;
    		return;
		}
		$.ajax({
	          type: 'POST',
	          headers: {
	              Accept: "application/json; charset=utf-8"
	          },
	          url: "createOrder/getTemplateById",
	          data: {"id":template_id},
	          success: function(data){
	            console.info(data);
	            localStorage.setItem("temp_info_select",data.data.temp_info);
	            localStorage.setItem("temp_info_table_source_arr",data.data.table_source_arr);
	            localStorage.setItem("temp_info_table_source_arr_str",data.data.table_source_arr_str);
	            localStorage.setItem("table_source_line_total",data.data.table_source_line_total);
	            localStorage.setItem("temp_info_table_source_arr_for_two",data.data.table_source_arr_for_two);
	            localStorage.setItem("temp_info_table_source_arr_str_for_two",data.data.table_source_arr_str_for_two);
	            localStorage.setItem("table_source_line_total_for_two",data.data.table_source_line_total_for_two);
	            localStorage.setItem("template_id",template_id);
	            localStorage.setItem("template_name_old",data.data.temp_name);
	            $(window.parent.document).find("[data-href='./html/createOrder/orderSee.html']")[0].click();
	    		$(window.parent.document).find("iframe[src='./html/createOrder/orderSee.html']")[0].src="./html/createOrder/template.html?order_no="+order_no+"&justSee=1";
	    		page.hideFunforSee(order_no);
	          }
	       });
	},
	hideFunforSee:function(order_no){
		var i=0;
		var Interval_i = setInterval (function(){
			console.info($("[src='./html/createOrder/template.html?order_no="+order_no+"&justSee=1']",parent.document).length);
			$("[src='./html/createOrder/template.html?order_no="+order_no+"&justSee=1']",parent.document).contents().find("#printArea").show();
			$("[src='./html/createOrder/template.html?order_no="+order_no+"&justSee=1']",parent.document).contents().find("#printArea").siblings().hide();//所有功能屏蔽
			$("[src='./html/createOrder/template.html?order_no="+order_no+"&justSee=1']",parent.document).contents().find("#formsubmitAsNewOrder").show();//保存新订单
			$("[src='./html/createOrder/template.html?order_no="+order_no+"&justSee=1']",parent.document).contents().find("#menubutton_index").show();//小工具
			if(i>5){
				clearInterval(Interval_i);
			}
			i++;
		},1000);
	},
	edit:function(self){//编辑
		var order_no=$(self).attr("order_no");
		var template_id=$(self).attr("template_id");
		if(template_id==0){
			alert("该订单没有模版,不可编辑");
			return;
		}
		var businessTemplate = $(self).attr("businessTemplate");
		if(businessTemplate == 1){//如果是商务订单产生的生产订单
			$(window.parent.document).find("[data-href='./bomBusiness/produceOrder/createOrder.html']")[0].click();
    		$(window.parent.document).find("iframe[src='./bomBusiness/produceOrder/createOrder.html']")[0].src="./bomBusiness/produceOrder/createOrder.html?mode=update&sysOrderNo="+order_no;
    		return;
		}
		$.ajax({
	          type: 'POST',
	          headers: {
	              Accept: "application/json; charset=utf-8"
	          },
	          url: "createOrder/getTemplateById",
	          data: {"id":template_id},
	          success: function(data){
	            console.info(data);
	            localStorage.setItem("temp_info_select",data.data.temp_info);
	            localStorage.setItem("temp_info_table_source_arr",data.data.table_source_arr);
	            localStorage.setItem("temp_info_table_source_arr_str",data.data.table_source_arr_str);
	            localStorage.setItem("table_source_line_total",data.data.table_source_line_total);
	            localStorage.setItem("temp_info_table_source_arr_for_two",data.data.table_source_arr_for_two);
	            localStorage.setItem("temp_info_table_source_arr_str_for_two",data.data.table_source_arr_str_for_two);
	            localStorage.setItem("table_source_line_total_for_two",data.data.table_source_line_total_for_two);
	            localStorage.setItem("template_id",template_id);
	            localStorage.setItem("template_name_old",data.data.temp_name);
	            $(window.parent.document).find("[data-href='./html/createOrder/orderEdit.html']")[0].click();
	    		$(window.parent.document).find("iframe[src='./html/createOrder/orderEdit.html']")[0].src="./html/createOrder/template.html?order_no="+order_no;
	          }
	       });
	},
	audit:function(self){//审核页面 修改订单状态
		var order_no=$(self).attr("order_no");
		var template_id=$(self).attr("template_id");
		if(template_id==0){
			alert("该订单没有模版,不可编辑");
			return;
		}
		var businessTemplate = $(self).attr("businessTemplate");
		if(businessTemplate == 1){//如果是商务订单产生的生产订单
			$(window.parent.document).find("[data-href='./bomBusiness/produceOrder/createOrder.html']")[0].click();
    		$(window.parent.document).find("iframe[src='./bomBusiness/produceOrder/createOrder.html']")[0].src="./bomBusiness/produceOrder/createOrder.html?mode=approval&sysOrderNo="+order_no;
    		return;
		}
		$.ajax({
	          type: 'POST',
	          headers: {
	              Accept: "application/json; charset=utf-8"
	          },
	          url: "createOrder/getTemplateById",
	          data: {"id":template_id},
	          success: function(data){
	            console.info(data);
	            localStorage.setItem("temp_info_select",data.data.temp_info);
	            localStorage.setItem("temp_info_table_source_arr",data.data.table_source_arr);
	            localStorage.setItem("temp_info_table_source_arr_str",data.data.table_source_arr_str);
	            localStorage.setItem("table_source_line_total",data.data.table_source_line_total);
	            localStorage.setItem("temp_info_table_source_arr_for_two",data.data.table_source_arr_for_two);
	            localStorage.setItem("temp_info_table_source_arr_str_for_two",data.data.table_source_arr_str_for_two);
	            localStorage.setItem("table_source_line_total_for_two",data.data.table_source_line_total_for_two);
	            localStorage.setItem("template_id",template_id);
	            localStorage.setItem("template_name_old",data.data.temp_name);
	            $(window.parent.document).find("[data-href='./html/createOrder/orderAudit.html']")[0].click();
	    		$(window.parent.document).find("iframe[src='./html/createOrder/orderAudit.html']")[0].src="./html/createOrder/audit.html?order_no="+order_no;
	          }
	       });
	},
	deletedialog:function(self){//删除提示框
		$("#modal-demo").modal("show");
		del_order_no=$(self).attr("order_no");
		del_id=$(self).val();
	},deletesure:function(){//删除ajax
		$.ajax({
	          type: 'POST',
	          url: "createOrder/deleteOrderInfoPrimary",
	          data: {"id":del_id,"order_no":del_order_no},
	          success: function(data){
	        	  reloadData();
	          }
	       });
		$("#modal-demo").modal("hide");
	},applyedit:function(self){//申请修改订单信息
		var order_no=$(self).attr("order_no");
		var template_id=$(self).attr("template_id");
		var my_order_p_product_no=$(self).attr("order_p_product_no");
		$.ajax({
          type: 'POST',
          url: "createOrder/getMyApplyInfo",
          data: {"orderNo":order_no},
          success: function(data){
        	  //如果已经申请了 提示
        	  console.info(data);
        	  if(data.result&&data.data.length>0){
        		  alert("订单已经申请,请勿重复提交\r\n" +
        		  		"申请人["+data.data[0].apply_user+"] 申请时间["+data.data[0].apply_time+"]\r\n" +
        		  				"请查询投料单-物料清单是否有申请修改");
        		  return;
        	  }
        	  var businessTemplate = $(self).attr("businessTemplate");
	      	  if(businessTemplate == 1){//如果是商务订单产生的生产订单
	      			$(window.parent.document).find("[data-href='./bomBusiness/produceOrder/applyOrder.html']")[0].click();
	          		$(window.parent.document).find("iframe[src='./bomBusiness/produceOrder/applyOrder.html']")[0].src="./bomBusiness/produceOrder/applyOrder.html?mode=applyUpdate&sysOrderNo="+order_no;
	          		return;
	      	  }
        	  $(window.parent.document).find("[data-href='./html/createOrder/orderApplyMainForApply.html']")[0].click();
      		  $(window.parent.document).find("iframe[src='./html/createOrder/orderApplyMainForApply.html']")[0].src=encodeURI("./html/createOrder/orderApplyMainForApply.html?template_id="+template_id+"&order_no="+order_no+"&order_p_product_no="+my_order_p_product_no);
          }
        });
		
	},applyAudit:function(self){//审核订单申请信息
		var order_no=$(self).attr("order_no");
		var template_id=$(self).attr("template_id");
		var audit_apply_id=$(self).attr("audit_apply_id");
		var my_order_p_product_no=$(self).attr("order_p_product_no");
		if(audit_apply_id==0){
			alert("当前订单["+order_no+"]查询不到申请单编号");
			return;
		}
		var businessTemplate = $(self).attr("businessTemplate");
		  if(businessTemplate == 1){//如果是商务订单产生的生产订单
				$(window.parent.document).find("[data-href='./bomBusiness/produceOrder/applyOrder.html']")[0].click();
	    		$(window.parent.document).find("iframe[src='./bomBusiness/produceOrder/applyOrder.html']")[0].src="./bomBusiness/produceOrder/applyOrder.html?mode=approvalApply&sysOrderNo="+order_no+"&applyId="+audit_apply_id;
	    		return;
		  }
		$(window.parent.document).find("[data-href='./html/createOrder/orderApplyMainForSeeAndAudit.html']")[0].click();
		$(window.parent.document).find("iframe[src='./html/createOrder/orderApplyMainForSeeAndAudit.html']")[0].src=encodeURI("./html/createOrder/orderApplyMainForSeeAndAudit.html?template_id="+template_id+"&order_no="+order_no+"&audit_apply_id="+audit_apply_id+"&order_p_product_no="+my_order_p_product_no);
	},qrcode:function(self){
		var order_no=$(self).attr("order_no");
		var order_p_product_no = $(self).attr("order_p_product_no");
		var order_p_version_no=$(self).attr("order_p_version_no");
		var order_p_company_order_no = $(self).attr("order_p_company_order_no");
		$("#qrcode-modal-demo").modal("show");
		$('#qrcodeDIV').empty();
		var qrcode=$('#qrcodeDIV').qrcode({//生成二维码
            render      : "canvas",
            text        : "http://www.shinehao.net/weixin/weiXin/sh?orderId="+order_no,
            render      : "canvas",//设置渲染方式
            width       : 200,     //设置宽度
            height      : 200,     //设置高度
            typeNumber  : -1,      //计算模式
            //correctLevel    : QRErrorCorrectLevel.H,//纠错等级
            background      : "#ffffff",//背景颜色
            //src: '../../../images/zfb_logo.jpg',
            foreground      : "#000000" //前景颜色
         });  
		var canvas=qrcode.find('canvas').get(0);
		//$('#qrcodeDIV').hide();
		var img = $('#imgOne').get(0);
		img.src = canvas.toDataURL('image/png');
		
		
		//二维码宽高
		var qrcodewidth = 200;
		var qrcodeheight = 200;
		//canvas宽高
		var canvaswidth = qrcodewidth;
		var canvasheight = qrcodeheight + 70;
		//文字描述位置
		var textleft = qrcodewidth / 2;
		var texttop = qrcodeheight + 20;
		img.onload = function() {
			canvas.width = canvaswidth;
			canvas.height = canvasheight;
			var ctx = canvas.getContext('2d');
			//设置画布背景
			ctx.fillStyle = '#ffffff';
			ctx.fillRect(0, 0, canvas.width, canvas.height);
			//设置文字样式
			ctx.fillStyle = '#000000';
			ctx.font = 'bold ' + 15 + 'px Arial';
			ctx.textAlign = 'center';
			//文字描述
			ctx.fillText(order_p_product_no, textleft, texttop);
			ctx.fillText(order_p_company_order_no, textleft, texttop+20);
			ctx.fillText(order_p_version_no, textleft, texttop+40);
			//绘制二维码
			ctx.drawImage(img, 0, 0);
			//设置logo
			//var logo = new Image(logowidth, logoheight);
			//logo.src = 'assets/img/hui.jpg';
			//logo.onload = function() {
			//	ctx.drawImage(logo, logoleft, logotop, logowidth, logoheight);
			//}
			$('#imgOne').hide();
		}
	},
	bomToCreate:function(self){
		var businessid=$(self).attr("businessid");
		$(window.parent.document).find("[data-href='./bomBusiness/produceOrder/createOrder.html']")[0].click();
		$(window.parent.document).find("iframe[src='./bomBusiness/produceOrder/createOrder.html']")[0].src=encodeURI("./bomBusiness/produceOrder/createOrder.html?mode=create&businessId="+businessid);
	}
}
function reloadData(){
	var table = $('#attendanceClassTable').DataTable();
	table.draw(false);
}
//查询
function queryClass(){
	//避免多次绑定
	$('#attendanceClassTable tbody').unbind("click");
	ajaxUtil.dataTablesAjax("attendanceClassTable",10,"order/getOrderList",
			{"order_p_buss_no":order_p_buss_no,"order_p_print":order_p_print,"order_p_product_no":order_p_product_no,"order_p_order_no":order_p_order_no,"order_p_order_no_sys":order_p_order_no_sys,"order_p_order_status":order_p_order_status,
			 "order_p_order_make_time_start":order_p_order_make_time_start,"order_p_order_make_time_end":order_p_order_make_time_end,"order_p_custmer":order_p_custmer,"order_p_created":order_p_created,"order_p_version_no":order_p_version_no,
			 "order_p_dept":order_p_dept},[
			{"data":"order_p_order_status",render:function(data,type,row){
					  if(!data) return '<span style="color:red" title="'+row.audit_msg+'">计划</span>';
					  if(data=="审核") return '<span style="color:green">审核成功</span>';
					  if(data!="审核") return '<span style="color:red" title="'+row.audit_msg+'">'+data+'</span>';
					  return '<span style="color:red">'+data+'</span>';
			} },
			{"data":"apply_status",render:function(data,type,row){
				if(data!=undefined){
					if(row.apply_status==-1){
						return "<span style='color:#CC9900'>申请待审核</span>";
					}
					if(row.apply_status==1){
						return "<span style='color:green' title='"+row.audit_remark+"'>申请审核成功</span>";
					}
					if(row.apply_status==0){
						return "<span style='color:gray' title='"+row.audit_remark+"'>申请审核失败</span>";
					}
					return "";
				}else{
					return "";
				}
			} },
			{"data":"order_p_company_order_no",render:function(data,type,row){
				if(data){
					return "<span title='系统订单编号"+row.order_p_order_no+"'>"+data+"</span>";
				}
				return "<span title='系统订单编号"+row.order_p_order_no+"'> </span>";
			} },
			{"data":"order_p_product_no",render:function(data,type,row){
				if(data){return data;}else{
					return "";
				}
			}},
			{"data":"deptName",render:function(data,type,row){
				if(data){return data;}else{
					return "";
				}
			}},
			{"data":"order_p_order_make_time",render:function(data,type,row){
				if(data){
					return '<span title="'+data+'">'+data.substring(0,10)+'</span>';
				}else{
					return "";
				}
			}},
			{"data":"order_p_delivery_time",render:function(data,type,row){
				if(data){
					return '<span title="'+data+'">'+data.substring(0,10)+'</span>';
				}else{
					return "";
				}
			}},
			{"data":"order_p_custmer", render:function(data,type,row){
				if(data){return data;}else{
					return "";
				}
			}},
			{"data":"order_p_version_no", render:function(data,type,row){
				if(data){return data;}else{
					return "";
				}
			}},
			{"data":"order_p_sumOrderTotal", render:function(data,type,row){
				if(data){return data;}else{
					return "";
				}
			}},
			{"data":"order_p_create", render:function(data,type,row){
				if(data){return data;}else{
					return "";
				}
			}},
			{"data":"order_p_buss_no", render:function(data,type,row){
				if(data){return data;}else{
					return "";
				}
			}},
			{"data":"order_p_print", render:function(data,type,row){
				if(data>0){
					return "<span style='color:green'>已打印</span>";
				}
				return "<span style='color:gray'>未打印</span>";
			}},
			{"data":"id",sWidth:"20%",render:function(data,type,row){
			   /*if(true){
				   return "<button class='edit-btn btn' type='button' value='"+data+"'>审核</button>";
			   }else{
				   return "<button class='edit-btn btn' type='button' value='"+data+"'>编辑</button>";
			   }*/
			   //console.info(row);
			   //如果没有系统订单编号 则是未生成生产订单的商务订单
			   if(row.order_p_order_no.length==0){
				   var bomToOrderStr="<button id='btn_bom_to_order' businessid='"+row.id+"' class='btn btn-link' onclick='page.bomToCreate(this)' type='button' value='"+data+"' style='color:gray'>生成生产订单</button>";;
				   return  bomToOrderStr+ "<button order_p_version_no='"+row.order_p_version_no+"' order_p_company_order_no='"+row.order_p_company_order_no+"' order_no='"+row.order_p_order_no+"' order_p_product_no='"+row.order_p_product_no+"' onclick='page.qrcode(this)' class='btn btn-link' type='button' value='"+data+"'>二维码</button>";
			   }
			   if(row.template_id!=0){
				   var str='';
				   var seeAndPrint=false;//查看权限
				   if(row.audit==1){//有审核权限
					   if(row.order_p_order_status!="审核"){//没审核     只有 订单审核权限
						   str+="<button id='btn_audit' businessTemplate='"+row.businessTemplate+"' order_no='"+row.order_p_order_no+"' template_id='"+row.template_id+"' class='btn btn-link' onclick='page.audit(this)' type='button' value='"+data+"' style='color:red'>订单审核</button>";
					   }else{//审核成功 有查看权限
						   seeAndPrint=true;
					   }
				   }
				   if(row.edit==1){//有编辑权限
					   if(row.order_p_order_status=="审核"){//审核了 有查看权限 申请修改
						   seeAndPrint=true;
						   if(row.applyTotal<=row.auditTotal){//申请数小于审核数 可以修改
							   str+="<button id='btn_audit' businessTemplate='"+row.businessTemplate+"' order_p_product_no='"+row.order_p_product_no+"' order_no='"+row.order_p_order_no+"' template_id='"+row.template_id+"' class='btn btn-link' onclick='page.applyedit(this)' type='button' value='"+data+"'>申请修改</button>";
						   }
					   }
					   if(row.order_p_order_status!="审核" && row.sort>=0){//没有审核成功有编辑权限下 如果没有投料单 可以删除订单
						   str+="<button id='btn_edit' businessTemplate='"+row.businessTemplate+"' order_no='"+row.order_p_order_no+"' template_id='"+row.template_id+"' onclick='page.edit(this)' class='btn btn-link' type='button' value='"+data+"'>编辑</button>";
						   str+="<button id='btn_edit' businessTemplate='"+row.businessTemplate+"' order_no='"+row.order_p_order_no+"' template_id='"+row.template_id+"' onclick='page.deletedialog(this)' class='btn btn-link' type='button' value='"+data+"'>删除</button>";
					   }
					   if(row.order_p_order_status=="审核" && row.hasFeedTotal==0 && row.sort>=0){//审核成功有编辑权限下 如果没有投料单 可以删除订单
						   /*str+="<button id='btn_edit'  order_no='"+row.order_p_order_no+"' template_id='"+row.template_id+"' onclick='page.edit(this)' class='btn btn-link' type='button' value='"+data+"'>编辑</button>";*/
						   str+="<button id='btn_edit'  order_no='"+row.order_p_order_no+"' template_id='"+row.template_id+"' onclick='page.deletedialog(this)' class='btn btn-link' type='button' value='"+data+"'>删除</button>";
					   }
				   }
				   if(seeAndPrint){
					   str+="<button id='btn_edit' businessTemplate='"+row.businessTemplate+"' order_no='"+row.order_p_order_no+"' template_id='"+row.template_id+"' onclick='page.seeAndPrint(this)' class='btn btn-link' type='button' value='"+data+"'>查看</button>";
				   }
				   if(row.audit==1&&row.applyTotal>row.auditTotal){//该订单有申请修改  且未审核 则出现更新审核权限 申请数大于审核数
					   str+="<button id='btn_audit' businessTemplate='"+row.businessTemplate+"' order_p_product_no='"+row.order_p_product_no+"' order_no='"+row.order_p_order_no+"' template_id='"+row.template_id+"' audit_apply_id='"+row.audit_apply_id+"' class='btn btn-link' onclick='page.applyAudit(this)' type='button' value='"+data+"' style='color:red'>更新审核</button>";
				   }
				   if(!seeAndPrint&&""==str){//没有任何权限只能查看
					   str+="<button id='btn_edit' businessTemplate='"+row.businessTemplate+"' order_no='"+row.order_p_order_no+"' template_id='"+row.template_id+"' onclick='page.seeAndPrint(this)' class='btn btn-link' type='button' value='"+data+"'>查看</button>";
				   }
				   str+="<button order_p_version_no='"+row.order_p_version_no+"' order_p_company_order_no='"+row.order_p_company_order_no+"' order_no='"+row.order_p_order_no+"' order_p_product_no='"+row.order_p_product_no+"' onclick='page.qrcode(this)' class='btn btn-link' type='button' value='"+data+"'>二维码</button>";

				   return str;
			   }
			   return '暂无操作' + "<button order_p_version_no='"+row.order_p_version_no+"' order_p_company_order_no='"+row.order_p_company_order_no+"' order_no='"+row.order_p_order_no+"' order_p_product_no='"+row.order_p_product_no+"' onclick='page.qrcode(this)' class='btn btn-link' type='button' value='"+data+"'>二维码</button>";
			} }
	]);
	$('#attendanceClassTable').on( 'init.dt', function ( e, settings ) {
		layer.msg("查询完成",{icon:1});
		//避免不对齐
		/*setTimeout(function(){
			var table = $.fn.dataTable.fnTables(true);
			if ( table.length > 0 ) {
			$(table).dataTable().fnAdjustColumnSizing();
			}
		},1000)*/
	});
	
}

/*
$("iframe[src='./html/createOrder/index_x.html']")[0].contentWindow.basic_index.getTempForOrder('182','SC180308000010')*/




